import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/login'
import Layout from '../views/Layout'
import Home from '../views/Layout/Home/index.vue'
import User from '../views/Layout/User/index.vue'

Vue.use(VueRouter)

const routes = [{
  path: '/',
  redirect: '/layout'
},
{
  path: '/login',
  component: Login
},
{
  path: '/layout',
  redirect: '/layout/home',
  component: Layout,
  children: [{
    path: 'home',
    component: Home
  },
  {
    path: 'user',
    component: User
  }
  ]
}
]

const router = new VueRouter({
  routes
})

export default router
